package com.example.guethe.fireanalysisapp.util;

/**
 * 基本工具，包含
 * 手机号码验证
 * Created by zhaoshengping on 2017/8/27.
 */

public class BaseUtil {

    private static final int MIN_CLICK_DELAY_TIME = 1000;
    private static long lastClickTime;

    public static boolean checkPhone (String phone) {
        String telRegex = "[1][34578]\\d{9}";
        return phone.matches(telRegex);
    }



    public static boolean isFastClick() {
        boolean flag = false;
        long curClickTime = System.currentTimeMillis();
        if ((curClickTime - lastClickTime) >= MIN_CLICK_DELAY_TIME) {
            flag = true;
        }
        lastClickTime = curClickTime;
        return flag;
    }
}
